<!-- The view to create/edit a medicine coefficient -->
<script src="{$base_dir}modules/dept_medicine/js/AJAX_Medicine.js" type="text/javascript" ></script>

<form id="addMedicineCoefForm" name="addMedicineCoefForm">
    <input type="hidden" id="medCoefId" name="medCoefId" value="{$medCoef.med_coef_id}">
    <div class="form_container" style="width: 460px;">
        <div>
            <span id="statusMessage" style="font-style: italic; color: red;"></span>
        </div>
        <table cellspacing="0" cellpadding="0">            
            <tr>
                <td>{translate}Department{/translate}</td>
                <td>
                    <select name='departmentLbx' id='departmentLbx'>
                        <option id='empty' value='empty'>{translate}Select department{/translate}</option>
                        {html_options options=$departments selected=$medCoef.department_id}                    
                    </select>
                </td>
            </tr>            
            <tr>
                <td>{translate}Medicine type{/translate}</td>
                <td>
                    <select name='medicineTypeLbx' id='medicineTypeLbx' onChange="javascript:getMedicineNames(false);">
                        <option id='empty' value='empty'>{translate}Select medicine type{/translate}</option>
                        {html_options options=$medTypes selected=$medCoef.medicine_type_id}                    
                    </select>
                </td>
            </tr>
            <tr>
                <td>{translate}Medicine name{/translate}</td>
                <td>
                    <select name='medicineNameLbx' id='medicineNameLbx' onChange="javascript:getQuantityTitle();">
                        <option id='empty' value='empty'>{translate}Select medicine name{/translate}</option>
                        {$medNamesHtml}                                           
                    </select>
                </td>
            </tr>
            <tr>
                <td>{translate}Quantity{/translate}</td>
                <td>
                    <input type="text" id="quantityNumTxt" name="quantityNumTxt" value="{$medCoef.quantity_num}"/>
                    &nbsp;
                    <span id="quantityTitle">{$medCoef.quantity_title}</span>
                </td>
            </tr>
        </table>
    </div>
    <!-- button -->
    <div align="right" style="padding-top: 10px; width: 480px;">
	    <div id="btn_save">
	        <a id="button_save" class="button_link" href="javascript:saveMedicineCoef();">
	            {if $medCoef.med_coef_id > 0}
	                {translate}Save{/translate}                  
	            {else}
	                {translate}Add new medicine coef.{/translate}
	            {/if}
	        </a>
	    </div>
	    <div id="barLoading" style="display:none;">
            <img src="{$base_uri}images/ajax-loader.gif"/>
        </div>
    </div>
</form>